
//获取窗口高度兼容模式
// function getClientHeight() {
//     var clientHeight = 0;
//     if (document.body.clientHeight && document.documentElement.clientHeight) {
//         var clientHeight = (document.body.clientHeight < document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight;
//     } else {
//         var clientHeight = (document.body.clientHeight > document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight;
//     }
//     return clientHeight;
// }
//事件最后加载
// function addLoadEvent(func) {
// //     window.addEventListener && window.addEventListener("load", func, false);
// //     window.attachEvent && window.attachEvent("onload", func);
// // }

// addLoadEvent(function() {
//     var userId = getCookie("user_id_l");
//     if (!userId) {
//         get_user();
//     }
// });


/**鼠标滑过图标出现变化**/
function setHover(btn) {
    //btn 当前点击的按钮
    $(btn).hover(function() {
        var _class = $(this).find("i").attr('class');
        var txt = _class + '-hover';
        $(this).find("i").removeClass(_class).addClass(txt);
    }, function() {
        var _class = $(this).find("i").attr('class');
        var length = _class.length - 6;
        var txt = _class.substr(0, length);
        $(this).find("i").removeClass(_class).addClass(txt);
    });
}


// 获取地址栏参数
function getUrlParms(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if (r != null)
        return unescape(r[2]);
    return null;
}


/**鼠标滑过出现弹层**/
function hoverPop(btn, content) {
    //btn 当前点击的按钮
    //content 显示的内容
    $(btn).hover(function() {
        $(content).stop(true).fadeIn(500);
    }, function() {
        $(content).stop(true).fadeOut(500);
    });
}

/**鼠标滑过滚出弹层**/
function slidePop(btn, content) {
    //btn 当前点击的按钮
    //content 显示的内容
    $(btn).hover(function() {
        $(content).stop(true).slideDown(200);
        var icon = $(this).find(".icon-down").length;
        if (icon > 0) {
            $(this).find(".icon-down").stop(true).animate({
                rotate: "-180deg"
            }, 300);
        }
    }, function() {
        $(content).stop(true).slideUp(200);
        var icon = $(this).find(".icon-down").length;
        if (icon > 0) {
            $(this).find(".icon-down").stop(true).animate({
                rotate: "0deg"
            }, 300);
        }
    });
}

/**选项卡**/
function setTab(tab, cont) {
    //tab 当前点击的导航
    //cont 打开的对应的内容
    var fun;
    if (arguments[2]) {
        fun = arguments[2];
    }
    $(tab).on("click", function() {
        var _index = $(this).index();
        var _box = $(cont).eq(_index);
        $(this).addClass("active").siblings().removeClass("active");
        _box.removeClass("hide").siblings(cont).addClass("hide");
        if (fun) {
            fun();
        }
    })
};

/**左侧导航自适应高度**/
function setSidebar(box, sidebar) {
    var boxH = $(box).height();
    $(sidebar).height(boxH);
}

// 隐藏/出现图表操作
function graphShow() {
    $(".js-changeIcon").click(function() {
        var card = $(this).parents(".graph-card");
        var _height;
        if (card.find(".icon").hasClass("icon-upward")) {
            card.find(".icon").addClass("icon-downward").removeClass("icon-upward");
            card.parents(".graph-box").animate({
                "height": 52
            }, 500, function() {
                $(this).css("overflow", "hidden");
            });
        } else {
            card.find(".icon").addClass("icon-upward").removeClass("icon-downward");
            if (card.parents(".graph-box").hasClass("graph-box-b")) {
                _height = 475;
            } else if (card.parents(".graph-box").hasClass("graph-box-h")) {
                _height = 575;
            } else {
                _height = 455;
            }
            card.parents(".graph-box").animate({
                "height": _height
            }, 500, function() {
                $(this).css("overflow", "visible");
            });
        }
    });
    $(".js-changeIcon").hover(function() {
        $(this).siblings(".icon-tips").show();
        if ($(this).hasClass("icon-upward")) {
            // $(this).siblings(".icon-tips").html('隐藏图表');
            $(this).attr("title", g_lang_array['js_hide_chart']);
        } else {
            // $(this).siblings(".icon-tips").html('显示图表');
            $(this).attr("title", g_lang_array['js_show_chart']);
        }
    }, function() {
        $(this).siblings(".icon-tips").hide();
    });

    // 显示图表固定按钮
    // $(document).on("mouseover", ".flex-graph", function() {
    //     $(this).find("p").show();
    // }).on("mouseout", ".flex-graph", function() {
    //     $(this).find("p").hide();
    // });

    // 点击图表固定按钮
    var show = true;
    $(document).on("click", ".flex-graph", function() {
        if (show) {
            _hmt.push(['_trackEvent', 'btn', 'click', g_lang_array['js_show_chart']]);
            $(".graph-box").each(function() {
                var _height;
                if ($(this).hasClass("graph-box-b")) {
                    _height = 475;
                } else if ($(this).hasClass("graph-box-h")) {
                    _height = 575;
                } else {
                    _height = 455;
                }
                $(this).animate({
                    "height": _height,
                    "marginTop": "20px"
                }, 400, function() {
                    $(this).css("overflow", "visible");
                });
            });
            $(this).find("p").html(g_lang_array['js_hide_chart']);
            $('html,body').animate({
                scrollTop: $("#scroll-tit").offset().top - 60
            }, 400);
            show = false;
        } else {
            $(".graph-box").each(function() {
                $(this).animate({
                    "height": 0,
                    "marginTop": 0
                }, 400, function() {
                    $(this).css("overflow", "hidden");
                });
            });
            $(this).find("p").html(g_lang_array['js_show_chart']);
            $('html,body').animate({
                scrollTop: 0
            }, 400);
            show = true;

        }
    });

    // 日期插件
    $(document).on("click", ".js-laydate", function() {
        var name = $(this).hasClass("start-time");
        var start = $(this).parents(".js-sellingTime").find(".start-time");
        var end = $(this).parents(".js-sellingTime").find(".end-time");
        var startId = start.attr("id");
        var endId = end.attr("id");
        var start_time = start.val();
        var end_time = end.val();
        var _format = "YYYY-MM-DD hh:mm:ss";
        var _istime = true;
        if ($(this).parents("dd").length > 0) {
            $(this).parents("dd").siblings().removeClass("active");
            $(this).parents("dd").prev().addClass("active");
        }
        if ($(this).hasClass("js-date")) {
            _format = "YYYY-MM-DD";
            _istime = false;
        }
        if (name) {
            if (end_time == "")
                end_time = "2099-01-01 00:00:00";
            var timeadd = new Date(end_time.replace(/-/g, "/"));
            timeadd = new Date(timeadd.getTime() - 1 * 60 * 60 * 1000);
            timeadd = timeadd.getFullYear() + "-" + (timeadd.getMonth() + 1) + "-" + timeadd.getDate() + " " + timeadd.getHours() + ":" + timeadd.getMinutes() + ":" + timeadd.getSeconds();
            laydate({
                elem: '#' + startId,
                istime: _istime,
                istoday: false,
                max: timeadd,
                format: _format
            });
        } else {
            if (start_time == "")
                start_time = "1900-01-01 00:00:00";
            var timeadd = new Date(start_time.replace(/-/g, "/"));
            timeadd = new Date(timeadd.getTime() + 1 * 60 * 60 * 1000);
            timeadd = timeadd.getFullYear() + "-" + (timeadd.getMonth() + 1) + "-" + timeadd.getDate() + " " + timeadd.getHours() + ":" + timeadd.getMinutes() + ":" + timeadd.getSeconds();
            laydate({
                elem: '#' + endId,
                istime: _istime,
                istoday: false,
                min: timeadd,
                format: _format
            });
        }
    });
}

//设置头部导航颜色变换及二级导航显示
function setNav() {
    // var w = $(window).width();
    var current = $(".system-head-nav>li.active");
    current.find(".icon-down").addClass("icon-down-blue");
    var index = current.index();
    $(".system-head-nav>li:eq(1)").addClass("bigData");
    current.find("span").css("color", "#26cfe8");
    var curLink = current.children("a");
    var second = current.find(".second-nav");
    if (curLink.length != 0) {
        var icon = curLink.children("span").find(".icon");
        if (icon.length != 0) {
            var _class = icon.attr("class");
            var txt = _class.substr(5) + "-blue";
            current.children("a").children("span").find(".icon").addClass(txt);
        }
    }
    // if (second.length > 0) {
    //     current.css({"padding": "9px 0"});
    //     // if(w < 1450){
    //     //     current.css({"padding": "18px 0"});
    //     // }
    //     if (second.find(".third-nav").length > 0) {
    //         var name = second.find(".third-nav .active font").html();
    //     } else {
    //         var name = second.find(".active font").html();
    //     }
    //     var curtips = '<p class="current-page">— ' + name + ' —</p>';
    //     current.children("a").append(curtips);
    // }


    var secCur = $('.second-nav>li.active');
    var link = secCur.children("a");
    if (link.length != 0) {
        var secicon = link.find(".icon");
        if (secicon.length != 0) {
            var _secclass = secicon.attr("class");
            var txt2 = _secclass.substr(5) + "-blue";
            secCur.children("a").find(".icon").addClass(txt2);
        }
    }
}

Date.prototype.Format = function(fmt) { //author: meizz
    if (this.getTime() == 0) {
        return "---";
    }
    var o = {
        "M+": this.getMonth() + 1, //月份
        "d+": this.getDate(), //日
        "h+": this.getHours(), //小时
        "m+": this.getMinutes(), //分
        "s+": this.getSeconds(), //秒
        "q+": Math.floor((this.getMonth() + 3) / 3), //季度
        "S": this.getMilliseconds() //毫秒
    };
    if (/(y+)/.test(fmt))
        fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
    for (var k in o)
        if (new RegExp("(" + k + ")").test(fmt))
            fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
    return fmt;
}


//设置菜单超出一行设置伸缩
function setScrollMenu() {
    var fun, par;
    if (arguments[0]) {
        fun = arguments[0];
    }
    if (arguments[1]) {
        par = arguments[1].parent();
    } else {
        par = $(".menu-scrolList");
    }
    var defaultH = 50;
    var parH = par.height();
    var h = par.find(".submenu-list").height() + 50;
    var channelid;
    var icon = "<i class='icon-more'></i>";
    var mult = "<div class='mult'><b class='f18 middle'>+</b><b class='name'>" + g_lang_array['js_multi_select'] + "</b></div>";
    var multbtn = "<dl class='menu-list multChoice-btn'><button class='btn confirm js-mult-confirm'>" + g_lang_array['js_sure'] + "</button><button class='btn cancel js-mult-cancel'>" + g_lang_array['js_cancel'] + "</button></dl>";
    if (h > parH) {
        if (par.find(".icon-more").length == 0) {
            par.find(".submenu-list").append(icon);
        }
        if (par.find(".multChoice-list").length > 0 && par.find(".mult").length == 0) {
            par.find(".submenu-list").append(mult);
        }
        if (parH > defaultH) {
            par.find(".icon-more").addClass("show").css({
                rotate: "-180deg"
            });
            par.height(h);
        }

    } else {
        if (h > defaultH) {
            if (par.find(".icon-more").length == 0) {
                par.find(".submenu-list").append(icon);
                par.find(".icon-more").addClass("show").css({
                    rotate: "-180deg"
                });
            }
        }
        par.height(h);
    };
    // 更多
    par.find(".icon-more").click(function() {
        if ($(this).hasClass("show")) {
            par.animate({
                height: defaultH
            }, 300);
            $(this).stop(true).animate({
                rotate: 0
            }, 300);
            $(this).removeClass("show");
        } else {
            par.animate({
                height: h
            }, 300);
            $(this).stop(true).animate({
                rotate: "-180deg"
            }, 300);
            $(this).addClass("show");
        }
    });
    //多选
    par.find(".mult").off().click(function() {
        if ($(this).hasClass("active")) {
            $(this).removeClass("active");
            par.removeClass("borderNone").removeClass("multChoice");
            par.next(".multChoice-btn").remove();
            $(".channel-item").removeClass("active");
            $(".channel-item[data-channelid='0']").addClass("active");
            // if($(this).siblings(".icon-more").hasClass("show")){
            //     $(this).siblings(".icon-more").trigger("click");
            // }
            if (fun) {
                fun();
            }
        } else {
            channelid = $(".channel-item.active").data("channelid");
            if (par.next(".multChoice-btn").length == 0) {
                par.addClass("borderNone").addClass("multChoice");
                par.after(multbtn);
            }
            $(this).addClass("active");
            if (!$(this).siblings(".icon-more").hasClass("show")) {
                $(this).siblings(".icon-more").trigger("click");
            }
            //关闭多选
            $(".js-mult-cancel").off().click(function() {
                par.find(".mult").trigger("click");
                // $(".channel-item").removeClass("active");
                // $(".channel-item[data-channelid='"+channelid+"']").addClass("active");
                // par.removeClass("borderNone").removeClass("multChoice");
                // par.next(".multChoice-btn").remove();
                // par.find(".mult").removeClass("active");
            });
            // 确定多选
            $(".js-mult-confirm").off().click(function() {
                if (fun) {
                    fun();
                }
                if ($(this).parent().prev().find(".icon-more").hasClass("show")) {
                    $(this).parent().prev().find(".icon-more").trigger("click");
                }
            });
        }
    });
}



//自适应图表高度
function setGroupH() {
    $(".js-graphBbox").each(function() {
        var h = $(this).height();
        var site = $(this).find(".graph-site");
        if (site.length > 0) {
            var siteH = site.height();
            $(this).find(".graph-block").height(h - siteH);
        }
    });
}

// top menu
function setPayAdapt() {
    var w = $(window).width();
    var mar = $(".system-box").css("margin-top");
    if (w < 1470) {
        $(".pay-mainbox").css({
            "width": 930,
            "margin": mar + " auto"
        });
    }
}

//topmenu
function shopPageAdapt() {
    var w = 1920;
    var h = 600;
    var curw = $(window).width();
    var curh = (h / w) * $(window).width();
    $(".shop-bg").css("height", curh);
    $(".shop-bg .cont").css({
        "transform": "scale(" + curw / w + ")"
    });

}


function llPageAdapt() {
    var w = 1920;
    var h = 952;
    var curw = $(window).width();
    var curh = (h / w) * $(window).width();
    $(".ll-bg").css("height", curh);

}


function llPage02Adapt() {
    var w = 1920;
    var h = 490;
    var curw = $(window).width();
    var curh = (h / w) * $(window).width();
    $(".ll-box02").css("height", curh);

}


$(function() {
    // 登录状态hover
    hoverPop(".js-payMsg", ".pay-cont");

    /**账号信息滚出**/
    slidePop(".js-nameOpen", ".name-slider");

    slidePop(".js-messageOpen", ".message-slider");



    //错误页面图标变换
    setHover(".page-error a");

    //在线商品编辑选项卡
    setTab(".goods-nav li", ".goods-cont");

    //支付界面选项卡
    setTab(".js-tab li", ".js-tabCont");

    // 图表显示隐藏
    graphShow();







    $(window).resize(function() {
        setPayAdapt();
        shopPageAdapt();
        llPageAdapt();
        llPage02Adapt();
    });

    // 后台系统头部导航事件
    $('.system-head-nav>li').hover(function() {
        var tw, _left, h;
        var winW = $(window).width();
        var curh = 0;
        var link = $(this).children("a");
        var len = $(this).find(".second-width").length;
        var w = 0;
        $(this).find(".icon-down").addClass("icon-down-blue").stop(true).animate({
            rotate: "-180deg"
        }, 300);
        if (link.length != 0 && !$(this).hasClass("active")) {
            var icon = link.find("span .icon");
            if (icon.length != 0) {
                var _class = icon.attr("class");
                var txt = _class.substring(5) + "-blue";
                $(this).children("a").find("span .icon").addClass(txt);
            }
        }
        $(this).find(".second-width").eq(len - 1).css("border-right", "none");
        for (var i = 0; i < len; i++) {
            w += $(this).find(".second-width").eq(i).innerWidth();
        }
        $(this).find(".second-width").parent("ul").width(w + len + 1);
        $(this).find(".second-nav").stop(true).slideDown(100);
        $(this).siblings().find(".second-nav").stop(true).slideUp(100);
        if ($(this).find(".second-width").parent("ul").length > 0) {
            tw = $(this).find(".second-width").parent("ul").width() + $(this).find(".second-width").parent("ul").offset().left;
        }
        if (tw > winW) {
            _left = tw - winW + 10;
            $(this).find(".second-width").parent("ul").css("left", -_left);
        }
        $(this).find("span").css("color", "#26cfe8");
        $(this).find(".second-width").each(function() {
            h = $(this).height();
            if (h > curh) {
                curh = h;
            }
        });
        $(this).find(".second-width").height(curh);
    }, function() {
        $(this).find(".second-nav").stop(true).slideUp(100);
        $(this).find(".icon-down").stop(true).animate({
            rotate: "0deg"
        }, 300);
        if (!$(this).hasClass("active")) {
            $(this).find(".icon-down").removeClass("icon-down-blue");
            $(this).find("span").css("color", "#fff");
            var link2 = $(this).children("a");
            if (link2.length != 0) {
                var icon2 = link2.find("span .icon");
                if (icon2.length != 0) {
                    var _class2 = icon2.attr("class")
                    var txt = _class2.split(' ');
                    $(this).children("a").find("span .icon").removeClass(txt[2]);
                }
            }
        }
    });
    $('.second-nav>li').hover(function() {
        var link = $(this).children("a");
        if (link.length != 0 && !$(this).hasClass("active")) {
            var icon = link.find(".icon");
            if (icon.length != 0) {
                var _class = icon.attr("class");
                var txt = _class.substring(5) + "-blue";
                $(this).children("a").find(".icon").addClass(txt);
            }
        }
    }, function() {
        var link = $(this).children("a");
        if (!$(this).hasClass("active")) {
            if (link.length != 0) {
                var icon = link.find(".icon");
                if (icon.length != 0) {
                    var _class = icon.attr("class");
                    var txt = _class.split(' ');
                    $(this).children("a").find(".icon").removeClass(txt[2]);
                }

            }
        }

    });

    //头部导航颜色变换及二级导航显示
    setNav();





    // 广告活动左侧导航
    $(document).on("click", ".js-cpc-sidebar a", function() {
        var par = $(".cpc-sidebar");
        var _this = $(this);
        if ($(this).siblings(".second-list-box").length > 0 && !par.hasClass("retract")) {
            if ($(this).find(".icon-triangle").hasClass("active")) {
                $(this).siblings(".second-list-box").slideUp(function() {
                    _this.parent().removeClass("open");
                });
            } else {
                $(this).siblings(".second-list-box").slideDown();
                $(this).parent().addClass("open");
            }
            $(this).find(".icon-triangle").toggleClass("active");
        }
    });

    // 广告活动左侧导航伸缩
    var cpc_tele = sessionStorage.getItem("cpc-tele");
    if (cpc_tele == 1) {
        $("#cpc-menu-sidebar").addClass("retract").css("left", "-142px");
        $(".cpc-main").css("marginLeft", "60px");
        $("#cpc-route").css({
            "width": "calc(100% - 72px)"
        }, {
            "left": "65px"
        });
        $("#cpc-menu-sidebar").find(".third-more").hide();
        $("#cpc-menu-sidebar").find(".second-list-box").hide();
        $(".common-video-box .item").hide();
    } else {
        $("#cpc-menu-sidebar").css("left", 0);
        $(".cpc-main").css("marginLeft", "205px");
        $("#cpc-route").css({
            "width": "calc(100% - 200px)"
        }, {
            "left": "185px"
        });
        $("#cpc-menu-sidebar").find(".third-more").show();
        $("#cpc-menu-sidebar").find(".second-list-box").show();
        $(".common-video-box .item").show();
        // $("#cpc-route").css({"width":"100%"},{"left":"185px"});
    }
    // 点击左侧导航
    $(document).on("click", ".js-cpc-tele", function() {
        var par = $(this).parents(".cpc-sidebar");
        var route_w = $("#cpc-route").width();
        if (par.hasClass("retract")) {
            par.animate({
                "left": 0
            }, 400);
            $(".cpc-main").animate({
                "marginLeft": 205
            }, 400);
            $("#cpc-route").animate({
                "width": route_w - 143
            }, 400);
            par.find("li.active .second-list-box").show();
            $(".finance-wrapper").animate({
                "marginLeft": 180
            }, 400);
            $(".oper-fixed-table").animate({
                "left": 180,
                "width": $(window).width() - 180
            }, 400);
            par.find("li .icon-triangle").removeClass("active");
            par.find("li.active .icon-triangle").addClass("active");
            par.find("li.active").addClass("open");
            par.removeClass("retract");
            par.find(".third-more").show();
            $(".common-video-box .item").show();
            sessionStorage.setItem("cpc-tele", 0);
        } else {
            $(".cpc-main").animate({
                "marginLeft": 60
            }, 400);
            $("#cpc-route").animate({
                "width": route_w + 143
            }, 400);
            $(".finance-wrapper").animate({
                "marginLeft": 42
            }, 400);
            $(".oper-fixed-table").animate({
                "left": 42,
                "width": $(window).width() - 42
            }, 400);
            par.animate({
                "left": "-142"
            }, 400, function() {
                par.addClass("retract");
                par.find(".second-list-box").hide();
                par.find(".third-more").hide();
                $(".common-video-box .item").hide();
            });
            sessionStorage.setItem("cpc-tele", 1);
        }
        var table_header_fixed_box = $(".table-header-fixed-box");
        if (table_header_fixed_box.length > 0) {
            var cpc_scroll_level = $(".cpc-scroll-level");
            var cpc_table_cont = $(".cpc-table-cont");
            var rateW = sessionStorage.getItem("cpc-tele") == 1 ? -120 : 120;
            var scroll_level_w = cpc_scroll_level.width();
            var left = cpc_table_cont.offset().left + rateW;
            var tableW = cpc_table_cont.width() - rateW;
            table_header_fixed_box.animate({
                "left": left,
                "width": tableW
            }, 400);
            table_header_fixed_box.find(".table-header-fixed.scroll").animate({
                "width": tableW
            }, 400);
            cpc_scroll_level.width(scroll_level_w - rateW);
        }

        if (window.sidebar_change) {
            setTimeout(function() {
                sidebar_change();
            }, 400);

        }
    });

    $(document).on("mouseover", ".cpc-sidebar.retract li", function() {
        $(this).find(".second-list-box").show();
        var len = $(this).find(".second-list-box").find("li").length;
        if (len == 1) {
            $(this).find(".second-list-box").addClass("one");
        }
    }).on("mouseout", ".cpc-sidebar.retract li", function() {
        $(this).find(".second-list-box").hide();
    });


    $(document).on('keydown', '.js-common-inputLimit', function(event) {
        var limit = $(this).data("limit");
        var limit_arr = limit.split(",");
        for (var i in limit_arr) {
            if (limit_arr[i] == "neg") {
                if (event.keyCode == 189 || event.keyCode == 109 || event.keyCode == 229) {
                    return false;
                }
            }
            if (limit_arr[i] == "dec") {
                if (event.keyCode == 229 || event.keyCode == 190 || event.keyCode == 110) {
                    return false;
                }
            }
        }
    });
});

$.fn.extend({
    // 光标处插入
    insertAtCaret: function(myValue) {
        var $t = $(this)[0];
        if (document.selection) {
            this.focus();
            sel = document.selection.createRange();
            sel.text = myValue;
            this.focus();
        } else
        if ($t.selectionStart || $t.selectionStart == '0') {
            var startPos = $t.selectionStart;
            var endPos = $t.selectionEnd;
            var scrollTop = $t.scrollTop;
            $t.value = $t.value.substring(0, startPos) + myValue + $t.value.substring(endPos, $t.value.length);
            this.focus();
            $t.selectionStart = startPos + myValue.length;
            $t.selectionEnd = startPos + myValue.length;
            $t.scrollTop = scrollTop;
        } else {
            this.value += myValue;
            this.focus();
        }
    },

    // 从下往上走马灯
    slideSroll: function(value) {
        var docthis = this;
        //默认参数
        value = $.extend({
            "li_h": "30",
            "time": 3000,
            "movetime": 1000
        }, value)

        //向上滑动动画
        function autoani() {
            $("li:first", docthis).animate({
                "margin-top": -value.li_h
            }, value.movetime, function() {
                $(this).css("margin-top", 0).appendTo(docthis);
            })
        }

        //自动间隔时间向上滑动
        var anifun = setInterval(autoani, value.time);

        //悬停时停止滑动，离开时继续执行
        $(docthis).children("li").hover(function() {
            clearInterval(anifun); //清除自动滑动动画
        }, function() {
            anifun = setInterval(autoani, value.time); //继续执行动画
        })
    }
});